package com.ant.collect.controller;


import com.ant.collect.common.ResultVo;
import com.ant.collect.service.IIndustryInformationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hzd
 * @since 2025-10-29
 */
@Api(tags = "行业信息接口")
@RestController
@RequestMapping("/industry-information")
public class IndustryInformationController {

    @Autowired
    IIndustryInformationService informationService;

    @ApiOperation(value = "通列表获取对应的数据结构列表")
    @GetMapping("/listTree")
    public ResultVo listTree(){
        return ResultVo.success("ok",informationService.listTree());
    }

    @PostMapping("/upload")
    public String uploadFile(@RequestParam("file") MultipartFile file) throws IOException {
        informationService.saveExcelData(file);
        return "文件上传并保存数据成功！";
    }
}
